import pageination from '../../components/pageination/pageination.vue'

export default {
	//数据
	data() {
			return {
				thatUrl: this.urls.baseUrl,
				total: 0, //总条数
				page: 1, //当前页
				size: 3, //每页显示条数
				baseData: [], // 基地展示数据
				fatherIndex:0, //一级菜单下标
			}
		},
		created() { //调用方法
			

		},
		components: {
			pageination
		},
		mounted() {

		},
		updated:function(){
			if(this.getParamValue("fatherIndex")){
				this.fatherIndex=this.getParamValue("fatherIndex");
			}
		},
		methods: { //写函数方法
			//基地详情
			NewsDetails: function(id) {
				this.set("baseDetailsid", id);
				this.$router.push({
					path: "baseDetails?fatherIndex="+this.fatherIndex,
				})
			},
			//页码切换执行方法
			pageFn: function(val, pid) {
				this.page = parseInt(val);
				//此处调列表数据接口
				this.getBaseData(); //查询新闻
			},
			getBaseData:function(){
				let that = this;
				// 基地展示数据
				that.$post(
					that.urls.basePage, {
						"pageNum": that.page,
						"pageSize": that.size,
						"list": [1, 2, 5]
					}
				)
				.then(function(res) {
					if (res.success) {
						that.baseData = res.pageInfo.list;
						that.total=res.pageInfo.total;
					}
				})
			}
		}
}